package com.teach;

import java.time.LocalDate;

/**
 * <pre>
 * - 父亲节6月的第3个星期天
 * Author : J.L.Zhou
 * E-Mail : 2233875735@qq.com
 * Tel : 151 1104 7708
 * Date : 2021-4-16 14:27:04
 * Version : 1.0
 * Copyright 2021 jlzhou.top Inc. All rights reserved.
 * Warning: this content is only for internal circulation of the company.
 *          It is forbidden to divulge it or use it for other commercial purposes.
 * </pre>
 *
 */
public class Demo0501 {

	public static void main(String[] args) {
		System.out.println(getFatherDay(2021));//6-20
		System.out.println(getFatherDay(2020));//6-21
	}
	
	public static LocalDate getFatherDay(int year) {
		LocalDate d = LocalDate.of(year, 6, 1);
		int count=0;
		do {
			if(d.getDayOfWeek().getValue()==7) {
				count++;
			}
			d = d.plusDays(1);
		}while(count<3);
		return d;
	}
}
